import request from '@/utils/request'

export function page(query) {
  return request({
    url: '/api/admin/tenant/page',
    method: 'get',
    params: query
  })
}
export function queryTenant() {
  return request({
    url: '/api/admin/tenant/queryTenant',
    method: 'get'
  })
}

export function addObj(obj) {
  return request({
    url: '/api/admin/tenant',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/api/admin/tenant/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/api/admin/tenant/' + id,
    method: 'delete'
  })
}

export function putObj(id, obj) {
  return request({
    url: '/api/admin/tenant/' + id,
    method: 'put',
    data: obj
  })
}

export function updateUser(id, obj) {
  return request({
    url: '/api/admin/tenant/' + id + '/user',
    method: 'put',
    params: obj
  })
}

export function getOwner(id) {
  return request({
    url: '/api/admin/tenant/' + id + '/user',
    method: 'get'
  });
}


// 获取所有工地信息
export function queryUserTenant() {
  return request({
    url: '/api/admin/tenant/queryUserTenant',
    method: 'get'
  });
}

export function changeTenant(tenantId) {
  return request({
    url: '/api/admin/user/changeTenant',
    method: 'post',
    params: { tenantId }
  });
}

export function copy() {
  return request({
    url: '/api/admin/checkStandard/copy',
    method: 'get'

  });
}
export function standardLibrary(id) {
  return request({
    url: '/api/admin/tenant/standardLibrary/' + id,
    method: 'get'
  });
}

export function getStandard(id) {
  return request({
    url: '/api/admin/tenant/getStandard',
    method: 'get',
    params: { id }
  });
}

export function deleteStandardLibrary(tenantId) {
  return request({
    url: '/api/admin/tenant/deleteStandardLibrary',
    method: 'delete',
    params: { tenantId }
  });
}

